package com.wechar_rpa.controller;

import com.wechar_rpa.model.ChatMessage;
import com.wechar_rpa.service.DesktopAppService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/desktop")
public class DesktopAppController {

    @Autowired
    private DesktopAppService desktopAppService;

    @GetMapping("/pending")
    public List<ChatMessage> getPendingReplies() {
        return desktopAppService.getPendingReplies();
    }

    @PostMapping("/reply")
    public void addReply(@RequestBody ChatMessage message) {
        desktopAppService.addPendingReply(message);
    }
}